﻿@model PMSMVC.Models.Project

@{
    ViewBag.Title = "Details";
}

<h2>Details</h2>

<fieldset>
    <legend>Project</legend>

    <div class="display-label">项目编号</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.ProjectID)
    </div>

    <div class="display-label">项目名称</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.ProjectName)
    </div>

    <div class="display-label">录入时间</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.RecordTime)
    </div>

    <div class="display-label">录入人</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.UserID)
    </div>

    <div class="display-label">项目状态</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.ProjectStatus)
    </div>
</fieldset>

<fieldset>
    <legend>ProductTypes</legend>
    @if (Model.ProductTypes.Count > 0)
    {
    <table>
            <tr>
                <th>
                    产品代码
                </th>
                <th>
                    产品名称
                </th>                
                <th>
                    客户
                </th>
                <th>
                    备注
                </th>
                @if (User.Identity.Name == Model.UserID)
                {
                <th>
                    操作
                </th>
                }
            </tr>

    @foreach (var item in Model.ProductTypes) {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.ProductTypeID)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ProductTypeName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.CustomerID)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Remark)
            </td>
            @if (User.Identity.Name == Model.UserID)
                {
            <td>                
                @Html.ActionLink("编辑", "Edit","ProductType", new { id = item.ProductTypeID },null) |
                @Html.ActionLink("删除", "Delete", "ProductType", new { id = item.ProductTypeID }, null)                
            </td>
                }
        </tr>
    }
</table>
    }
</fieldset>
<p>
    @Html.ActionLink("Edit", "Edit", new { id = Model.ProjectID }) |
    @Html.ActionLink("Back to List", "Index")
</p>
